package com.company.作业;

import java.util.Scanner;

public class sb {
        public static void main(String[] args) {
                String a[]={"商品1","商品2","商品3","商品4","商品5","商品6","商品7","商品8","商品9","商品10"};
                Scanner sc=new Scanner(System.in);
                double b[]=new double[10];
                for (int i=0;i<a.length;i++){
                    System.out.print("请输入"+a[i]+"的价格：");
                    b[i]=sc.nextDouble();
                }
                double sum=0;
                for (int i=1;i<a.length;i++){
                    System.out.println(a[i]+"的价格为："+b[i]+"元");
                    sum=sum+b[i];
                }
                System.out.println("总金额为："+sum+"元");
            }

        }


